package com.example.demo.mapper;

import com.example.demo.entity.Student;
import com.example.demo.entity.StudentQueryParam;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;

@Mapper
public interface StudentMapper {


    /**
     * 分页查询
     * @param param
     * @return
     */
    List<Student> getPage(StudentQueryParam param);

    /**
     * 新增student
     * @param student
     */
    void insert(Student student);

    /**
     * 根据id查询
     * @param id
     * @return
     */
    Student getById(Integer id);

    /**
     * 修改student
     * @param student
     */
    void update(Student student);

    /**
     * 删除student
     * @param ids
     */
    void delete(List<Integer> ids);


    /**
     * 获取学生学历数据
     * @return
     */
    @MapKey("name")
    List<Map> getStudentDegreeData();


    /**
     * 获取学生班级数据
     * @return
     */
    @MapKey("pos")
    List<Map<String, Object>> getStudentCountData();
}
